home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-09-12 | 1.3 KB | 39 lines | [TEXT/CWIE] |
- ///--------------------------------------------------------------------------------------
- // MyUtils.c
- ///--------------------------------------------------------------------------------------
-
- #include "MyUtils.h"
-
-
- ///--------------------------------------------------------------------------------------
- // FillBackgroundWithPict - fills background with pict, aligning to bottom of screen
- ///--------------------------------------------------------------------------------------
-
- void FillBackgroundWithPict(SpriteWorldPtr spriteWorldP, PicHandle thePictH)
- {
- Rect pictRect, oldPictRect, backRect;
- short pictOffset;
-
- SWSetPortToBackground(spriteWorldP);
- pictRect = (**thePictH).picFrame;
- backRect = spriteWorldP->backRect;
-
- // Align the picture to the bottom of the screen, not the top, so the rocks
- // always appear, regardless of the screen size
- pictOffset = backRect.bottom - pictRect.bottom;
- OffsetRect(&pictRect, 0, pictOffset);
- DrawPicture(thePictH, &pictRect);
-
- // Use the SpriteWorld's offscreenDrawProc to fill the rest of the background
- while (pictRect.right < backRect.right)
- {
- oldPictRect = pictRect;
- OffsetRect(&pictRect, pictRect.right - pictRect.left, 0);
-
- (*spriteWorldP->offscreenDrawProc)(spriteWorldP->backFrameP,
- spriteWorldP->backFrameP, &oldPictRect, &pictRect);
- }
- }
-
-
-